﻿using System;
using System.Net;
using System.Xml.Linq;
using System.Linq;

namespace ArmoryBrowser.Entities
{
    public class SummaryCategory
    {
        #region Fields
        private Achievement _achievementField;
        private string _idField;
        private string _nameField;
        #endregion
        #region Properties
        public Achievement Achievement
        {
            get
            {
                return this._achievementField;
            }
            set
            {
                this._achievementField = value;
            }
        }

        public string Id
        {
            get
            {
                return this._idField;
            }
            set
            {
                this._idField = value;
            }
        }

        public string Name
        {
            get
            {
                return this._nameField;
            }
            set
            {
                this._nameField = value;
            }
        }
        #endregion
        #region Constructor
        public SummaryCategory(XElement element)
        {
            Achievement = element.Elements("c").Select(e => new Achievement(e)).FirstOrDefault();
            Id = element.GetAttributeValue("id");
            Name = element.GetAttributeValue("name");
        }
        #endregion
    }
}
